﻿namespace EyeOpen.Domain
{
	using System;

	public static class AggregateExtensions
	{
		public static T SetId<T>(this T aggregate)
			where T : Aggregate
		{
			if (aggregate.Id == Guid.Empty)
			{
				aggregate.Id = Guid.NewGuid();
			}

			return aggregate;
		}
	}
}